Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[parachain-template] pallet configurations into mod configs #3809

Conversation

asiniscalchi
Copy link
Contributor

@asiniscalchi asiniscalchi commented Mar 24, 2024

This PR introduces a refactor of the parachain runtime configuration by consolidating all pallet configurations into a new module named configs. This change aims to improve the readability and maintainability of the runtime configuration by centralizing all configuration parameters.

Changes

  • Creation of configs.rs: A new file configs.rs has been added under templates/parachain/runtime/src/, containing all the runtime configurations previously scattered across lib.rs.
  • Refactoring of lib.rs: The lib.rs file has been significantly slimmed down by removing the inline pallet configurations and importing them from configs.rs instead.
  • Optimization of Import Statements: Reorganized import statements to clarify the runtime's dependency structure.

Benefits

  • Improved Readability: With configurations being centralized, developers can now easily locate and review runtime parameters without navigating through the lib.rs file.

This refactor does not introduce any changes to the runtime logic but improves the project structure for better development experience.

@asiniscalchi asiniscalchi changed the title all the pallets configs into mod configs [parachain-template] Consolidate all pallet configurations into mod configs Mar 24, 2024
@asiniscalchi asiniscalchi marked this pull request as ready for review March 24, 2024 14:54
@asiniscalchi asiniscalchi changed the title [parachain-template] Consolidate all pallet configurations into mod configs [parachain-template] all pallet configurations into mod configs Mar 24, 2024
@asiniscalchi asiniscalchi marked this pull request as draft March 24, 2024 15:00
@asiniscalchi asiniscalchi marked this pull request as ready for review March 24, 2024 15:40
@asiniscalchi asiniscalchi marked this pull request as draft March 24, 2024 15:50
@asiniscalchi asiniscalchi marked this pull request as ready for review March 24, 2024 15:53
@asiniscalchi asiniscalchi changed the title [parachain-template] all pallet configurations into mod configs [parachain-template] pallet configurations into mod configs Mar 25, 2024
@bkchr bkchr added the R0-silent Changes should not be mentioned in any release notes label Mar 26, 2024
@bkchr bkchr requested a review from kianenigma March 26, 2024 17:24
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5685788

@asiniscalchi
Copy link
Contributor Author

@kianenigma ping :)

/// [`ParaChainDefaultConfig`](`struct@frame_system::config_preludes::ParaChainDefaultConfig`),
/// but overridden as needed.
#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig)]
impl frame_system::Config for Runtime {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all the ones that are mentioned here actually overwriting something? type Hash, type BlockWeight etc should be the same in ParachainDefaultConfig

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good step, but if interested, I would suggest you to:

  • provide sensible defaults for Solochain and Parachain for: balances, system, timestamp, transaction-payment, sudo.
  • Update all 3 templates to use these defaults.
  • @gupnik can provide supervision.

@asiniscalchi
Copy link
Contributor Author

This is a good step, but if interested, I would suggest you to:

  • provide sensible defaults for Solochain and Parachain for: balances, system, timestamp, transaction-payment, sudo.
  • Update all 3 templates to use these defaults.
  • @gupnik can provide supervision.

Here you are: #3916

@kianenigma kianenigma added this pull request to the merge queue Apr 1, 2024
Merged via the queue into paritytech:master with commit 8d30534 Apr 1, 2024
127 of 132 checks passed
pgherveou pushed a commit that referenced this pull request Apr 2, 2024
This PR introduces a refactor of the parachain runtime configuration by
consolidating all pallet configurations into a new module named
`configs`. This change aims to improve the readability and
maintainability of the runtime configuration by centralizing all
configuration parameters.

## Changes
- **Creation of `configs.rs`**: A new file `configs.rs` has been added
under `templates/parachain/runtime/src/`, containing all the runtime
configurations previously scattered across `lib.rs`.
- **Refactoring of `lib.rs`**: The `lib.rs` file has been significantly
slimmed down by removing the inline pallet configurations and importing
them from `configs.rs` instead.
- **Optimization of Import Statements**: Reorganized import statements
to clarify the runtime's dependency structure.

### Benefits
- **Improved Readability**: With configurations being centralized,
developers can now easily locate and review runtime parameters without
navigating through the `lib.rs` file.

This refactor does not introduce any changes to the runtime logic but
improves the project structure for better development experience.

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Ank4n pushed a commit that referenced this pull request Apr 9, 2024
This PR introduces a refactor of the parachain runtime configuration by
consolidating all pallet configurations into a new module named
`configs`. This change aims to improve the readability and
maintainability of the runtime configuration by centralizing all
configuration parameters.

## Changes
- **Creation of `configs.rs`**: A new file `configs.rs` has been added
under `templates/parachain/runtime/src/`, containing all the runtime
configurations previously scattered across `lib.rs`.
- **Refactoring of `lib.rs`**: The `lib.rs` file has been significantly
slimmed down by removing the inline pallet configurations and importing
them from `configs.rs` instead.
- **Optimization of Import Statements**: Reorganized import statements
to clarify the runtime's dependency structure.

### Benefits
- **Improved Readability**: With configurations being centralized,
developers can now easily locate and review runtime parameters without
navigating through the `lib.rs` file.

This refactor does not introduce any changes to the runtime logic but
improves the project structure for better development experience.

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
dharjeezy pushed a commit to dharjeezy/polkadot-sdk that referenced this pull request Apr 9, 2024
…tech#3809)

This PR introduces a refactor of the parachain runtime configuration by
consolidating all pallet configurations into a new module named
`configs`. This change aims to improve the readability and
maintainability of the runtime configuration by centralizing all
configuration parameters.

## Changes
- **Creation of `configs.rs`**: A new file `configs.rs` has been added
under `templates/parachain/runtime/src/`, containing all the runtime
configurations previously scattered across `lib.rs`.
- **Refactoring of `lib.rs`**: The `lib.rs` file has been significantly
slimmed down by removing the inline pallet configurations and importing
them from `configs.rs` instead.
- **Optimization of Import Statements**: Reorganized import statements
to clarify the runtime's dependency structure.

### Benefits
- **Improved Readability**: With configurations being centralized,
developers can now easily locate and review runtime parameters without
navigating through the `lib.rs` file.

This refactor does not introduce any changes to the runtime logic but
improves the project structure for better development experience.

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants